<template>
    <div id="tmpl">
        <mt-header fixed title="Vue商城系统">
            <router-link v-bind="{to:'/goods/goodsinfo/'+id}" slot="left">
                <mt-button icon="back">返回</mt-button>
            </router-link>
            <!-- <mt-button icon="more" slot="right"></mt-button> -->
        </mt-header>
        <h4 v-text="info.title"></h4>
        <p class="line"></p>
        <p v-html="info.content"></p>
    </div>
</template>

 <script type="text/ecmascript-6">
 import { Toast } from 'mint-ui'
import common from '../../kits/common.js'
export default {
    data() {
        return {
            id:0,
            info:{}
        }

    },
    created(){
        this.id = this.$route.params.id;
        this.getgoodsdec();
    },
    methods: {
        getgoodsdec(){
             var url = common.apidomain + "/api/goods/getdesc/" + this.id;
            this.$http.get(url).then(function (response) {
                if (response.body.status != 0) {
                    Toast(response.body.message);
                    return;
                }
                this.info = response.body.message[0] ;
                // console.log(response.body)

            })
        }
    }
}
</script>

<style scoped >
#tmpl h4{
    color: #0094ff ;
    /* height: 30px; */
    padding: 5px 0 ; 
}
#tmpl .line{
    height: 1px;
    border: 1px solid rgba(0, 0, 0, 0.5);
}
</style>
